package com.eversec.scheduled;

import com.eversec.dao.FeatureRepository;
import com.eversec.domain.FeatureModel;
import com.eversec.thread.InsertThread;
import com.eversec.util.MD5Util;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;

import java.util.Date;

/**
 * Created by eversec on 2017/7/11.
 */
@Configuration
@EnableScheduling
public class InsertFeatureScheduled {

    private final Log log = LogFactory.getLog(this.getClass());


    @Autowired
    private FeatureRepository repository ;

    @Scheduled(cron = "0/10 * * * * ?")
    public void insertTask1(){

        log.info("*******************insertTask1()************************");
        new InsertThread(repository).run();

    }

    @Scheduled(cron = "0/20 * * * * ?")
    public void insertTask2(){

        log.info("*******************insertTask2()************************");
        new InsertThread(repository).run();


    }


    @Scheduled(cron = "0/30 * * * * ?")
    public void insertTask3(){

        log.info("*******************insertTask3()************************");
        new InsertThread(repository).run();


    }

    @Scheduled(cron = "0/40 * * * * ?")
    public void insertTask4(){

        log.info("*******************insertTask4()************************");
        new InsertThread(repository).run();


    }

    @Scheduled(cron = "0/50 * * * * ?")
    public void insertTask5(){

        log.info("*******************insertTask5()************************");
        new InsertThread(repository).run();


    }

}
